package com.ihr360.shared.validator;

import com.ihr360.commons.context.session.Ihr360SessionContextHolder;
import com.ihr360.validation.ValidationUtils;
import com.ihr360.validation.Validator;

public abstract class SessionValidator<T> implements Validator<T> {
    @Override
    public boolean supports(Class<?> clazz) {
        return true;
    }

    @Override
    public void validate(T target) {
        String companyId = Ihr360SessionContextHolder.getCompanyId();
        ValidationUtils.rejectIfEmpty(companyId,null,"无法获取公司信息");
    }
}